const { ccclass, property } = cc._decorator;

/**
 * UI界面基类
 * 定义基本UI操作：初始显隐状态、显示、隐藏
 */
@ccclass
export default class UIBase extends cc.Component {

    @property({ displayName: '初始显隐状态' })
    isShowInit: boolean = false

    onLoad() {
        console.log('UIBase onLoad()')
        if (this.isShowInit) {
            this.show()
        } else {
            this.hide()
        }
    }

    public show(): void {
        this.node.active = true
    }

    public hide(): void {
        this.node.active = false
    }
}
